package org.dairy.farms.dao.generic;

import org.dairy.farms.dao.exception.PersistenceException;

import java.io.Serializable;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: gduggira
 * Date: Jun 9, 2011
 * Time: 5:48:10 PM
 */

public interface DAO<T, ID extends Serializable> {

    T getById(ID id) throws PersistenceException;
    
    T findById(ID id) throws PersistenceException;

    T create(T object) throws PersistenceException;

    void update(T object) throws PersistenceException;

    void delete(T object) throws PersistenceException;

    public <T> List<T> findByProperty(String propertyName, Object value) throws PersistenceException;

     public List<T> loadAllObjects() throws PersistenceException ;
}